package com.vmove.childtrain.activity;

import android.view.KeyEvent;
import android.widget.Toast;

import com.vmove.childtrain.common.AppManager;
import com.vmove.childtrain.common.BaseSerialActivity;
import com.vmove.childtrain.common.Constants;

public abstract class BaseLessonActivity extends BaseSerialActivity {
    //执行课程训练时，把串口发送间隔设置大一些
     public void startRun(){
         Constants.COMMAND_INTERVAL = 100;
     }

     //结束课程训练后，恢复串口发送间隔
     public void stopRun(){
         Constants.COMMAND_INTERVAL = 50;
     }

    /*@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
            finish();
            return true;
        }
        return false;
    }*/

    @Override
    public void onBackPressed() {
        AppManager.getAppManager().finishActivity(this);
    }
}
